def hello(name):
    '''
    :param name name
    this is hello world
    :return: null
    '''
    print(name)


hello("tom")
help(hello)


def grith(width, height=10):
    print("width", width)
    print("height", height)


grith(1)
grith(width=1, height=2)
grith(height=2, width=1)
grith(1, height=2)


def test(*books, num):
    print(books)
    for n in books:
        print(n)
    print("num=", num)


def test_after(num, *books):
    print("num=", num)
    print(books)
    for n in books:
        print(n)


test((1, 1, 2, 2, 2, 2, 2, 2), num=9999999999)

test_after(9999999999999999, (1, 1, 2, 2, 2, 2, 2, 2))


def hello():
    age = 20
    print(age)
    print(locals()['age'])
    locals()['age'] = 2
    print(age)
    globals()['age'] = 222
    print(age)


hello()

print("==================================")

name = 'tom'


def inner_test():
    name = 'tony'
    print(name)


inner_test()
print(name)

print("==================================")


def global_test():
    global name
    print(name)
    name = "tony"
    print(name)


global_test()
print(name)

print("crazy====================")


def test():
    age = 20
    print(age)
    print(locals())
    print(locals()['age'])
    locals()['age'] = 12
    print('XXXXX', age)
    globals()['x']=19
x=5
y=20
print(globals())
print(locals())
print(x)
print(y)
test()